package com.julang.check.bean;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.Email;
/**
 * @author 赵自强
 * */
@TableName(value = "j_user")
@ApiModel(value = "User", description = "用户信息")
public class User {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "用户id")
    private Integer id;
    @ApiModelProperty(value = "用户昵称")
    private String username;
    @JsonIgnore
    private String password;
    @Email
    @ApiModelProperty(value = "用户邮箱")
    private String email;
    @ApiModelProperty(value = "用户手机号码")
    private String phonenumber;
    @TableField
    @ApiModelProperty(value = "用户积分")
    private float jifen;
    public String getEmail() {
        return email;
    }

    public User() {
    }

    public User(RequestEntity.RegisterBody registerBody) {
        this.username = registerBody.getUsername();
        this.password = registerBody.getPassword();
        this.email = registerBody.getEmail();
        this.phonenumber = registerBody.getPhonenumber();
        this.jifen = 0;
    }
    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhonenumber() {
        return phonenumber;
    }

    public void setPhonenumber(String phonenumber) {
        this.phonenumber = phonenumber;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public float getJifen() {
        return jifen;
    }

    public void setJifen(float jifen) {
        this.jifen = jifen;
    }

    public User(Integer id, String username, String password, @Email String email, String phonenumber, float jifen) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.email = email;
        this.phonenumber = phonenumber;
        this.jifen = jifen;
    }
}
